package com.ftg.learn.lesson3;


/**
 * if switch
 *
 * @author kangjx
 * @version 1.0
 * @date 2023/6/7 下午1:27
 */
public class Homework01 {

    public static void main(String[] args) {
        int a = 81;
        int b = 13;
        int c = 23;

        System.out.println("使用数学帮助类");

        /**
         * java.lang包下面的类，不用声明引入
         * 如果一个类里面只有一个构建方法 并且用private修饰不能使用new关键字
         *  static : 静态
         *  math叫数学帮助类
         *   里面提供了大量与数学 三角函数相关的方法
         */
        int max1 = Math.max(Math.max(a, b), c);
        System.out.println(max1);

        int min1 = Math.min(Math.min(a, b), c);
        System.out.println(min1);

        System.out.println("没有第三个变量");
        if (a < b) {
            if (b < c) {
                System.out.println(c);
            } else {
                System.out.println(b);
            }
        } else {

            if (a < c) {
                System.out.println(c);
            } else {
                System.out.println(a);
            }
        }

        System.out.println("第三个变量 ");
        int max = Integer.MIN_VALUE;
        if (max < a) {
            max = a;
        }
        if (max < b) {
            max = b;
        }
        if (max < c) {
            max = c;
        }
        System.out.println(max);

        int totalReport = 121;
        int reportSize = 10;
        int pageSize = 0;
        if (totalReport % reportSize == 0) {
            pageSize = totalReport / reportSize;
        } else {
            pageSize = totalReport / reportSize + 1;
        }

        System.out.println(pageSize);
        double a1 = totalReport;
        int d = (int) Math.ceil(a1 / reportSize);

        System.out.println(d);

        System.out.println("math随机");

        //[0,1)
        System.out.println(Math.random() * 10);

//        3-7   0-4 + 3
        //20 - 50  (int)(Math.random() *（最大値-最小値+1）) + 最小値;
        System.out.println((int) (Math.random() * 5) + 3);

        int n = (int) (Math.random() * 3) + 1;
        switch (n) {
            case 1:
                System.out.println("剪子");
                break;
            case 2:
                System.out.println("石头");
                break;
            default:
                System.out.println("布");
        }




    }

}
